//获取DOM---------------------------------------------------------------------
var getClassDom = function(nodeClassName){
    return document.querySelector(nodeClassName);
}
var getIdDom = function(nodeIdName){
    return document.querySelector(nodeIdName);
}
var username = getIdDom('#username');
var pwd = getIdDom('#pwd');
var login_btn = getClassDom('.login-btn');
var msg_text = getClassDom('.msg-text');
login_btn.addEventListener("click",function(){
    if(!username.value || !pwd.value){
        msg_box_open(msg_box_close);
        msg_text.innerText = "账号或密码不能为空";
        msg_text.style.fontSize = "small";
    }else if(isNaN(username.value)){
       
        msg_box_open(msg_box_close);
        msg_text.innerText = "账号只能为数字";
        msg_text.style.fontSize = "small";
    }else if(pwd.value=="123456"){
        msg_box_open(msg_box_close);
        msg_text.innerText = "密码不正确";
        msg_text.style.fontSize = "medium";
    }else{
        location.href="index.html";
    }
})

var back_btn = document.querySelector(".back-btn");

back_btn.addEventListener("click",function(){
    goBack();
})

